I used to be content with using ChatGPT's web version until I realized that I had to constantly verify that I was human and refresh the page to avoid errors. So, I decided to develop a desktop client for myself.
Here's the Result -> oliwang/GPTChatClient: Desktop chat app built with OpenAI API and PyQt6.
3 Things I learned
Details are in the repo readme file.
I was testing whether I should use setHtml
or setMarkdown
, so I asked ChatGPT to generate a simple PyQt6 program that has two QTextEdit
. You type markdown on the left, the program renders HTML on the right. Below is the exact code that was generated. I didn't change anything and it runs perfectly. Wow, it saved me so much time.
import markdown
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
class MarkdownPreviewWidget(QWidget):
def __init__(self):
super().__init__()
self.layout = QHBoxLayout()
self.text_edit = QTextEdit()
self.text_edit.setTabChangesFocus(True)
self.text_edit.textChanged.connect(self.refresh_preview)
self.preview_edit = QTextEdit()
self.preview_edit.setReadOnly(True)
self.layout.addWidget(self.text_edit)
self.layout.addWidget(self.preview_edit)
self.setLayout(self.layout)
def refresh_preview(self):
md_text = self.text_edit.toPlainText()
html_text = markdown.markdown(md_text)
self.preview_edit.setHtml(html_text)
if __name__ == "__main__":
app = QApplication([])
window = QMainWindow()
window.setGeometry(200, 200, 800, 600)
central_widget = MarkdownPreviewWidget()
window.setCentralWidget(central_widget)
window.show()
app.exec()
nacmartin/manitas: Move your fingers in the air to interact with a computer ☝️☝️
Large language models change everything for linguistics, starting with Chomsky
text-davinci-003
model on the Self-Instruct instruction-following evaluation suite"💌Subscribe and/or 📧Email